<meta charset="utf-8">
<style>

        .lay-box{
            border: 1px #dfdfdf solid;
            width: 98%;
            height: 95%;
            margin: 0 auto;
            padding-top: 1rem;
        }
        .lay-box .lay-content{
            width: 40%;
            margin-left: 20%;
            height: 2rem;
        }
        .lef{
            width: 25%;
            text-align: right;
            float: left;
        }
        .lay-box .lay-content .lay-span{
            font-size: 0.2rem;
            color: #a4a4a4;
            text-align: right;
        }
        .lay-box .lay-content .rig{
            float: right;
            width: 75%;
        }
        select{
            border: 1px solid #9F9F9F;
            font-size: 0.7rem;
            padding: 0.25rem 0.4rem;
            margin-left: 0.2rem;
            color: black;
            width: 82%;
            outline:none;
        }
        .lay-box .lay-content .rig .lay-input-text{
            border: 1px solid #9F9F9F;
            font-size: 0.7rem;
            padding: 0.28rem 0.4rem;
            margin-left: 0.2rem;
            color: black;
            outline:none;
            border-radius: 1px;
        }
        .lay-box .lay-content .rig .lay-submit{
            background: #01AAED;
            padding: 0.5rem 3rem;
            color: white;
            border-radius: 6px;
            margin-top: 1.2rem;
            outline:none;
            border: none;
        }

    </style>
<div class="lay-box">

    <div class="lay-content">
        <div class="lef">
            <span class="lay-span">原密码：</span>
        </div>
        <div class="rig">
            <input type="password" placeholder="原密码" class="lay-input-text" name="password"><br>
        </div>
    </div>
    <div class="lay-content">
        <div class="lef">
            <span class="lay-span">新密码：</span>
        </div>
        <div class="rig">
            <input type="password" placeholder="新密码" class="lay-input-text" name="new_password"><br>
        </div>
    </div>
    <div class="lay-content">
        <div class="lef">
            <span class="lay-span">新密码：</span>
        </div>
        <div class="rig">
            <input type="password" placeholder="新密码" class="lay-input-text"  name="re_password"><br>
            <input type="submit" value="提交" class="lay-submit" onclick="btnEditMember()">
        </div>
    </div>
</div>
<script src="/resource/libs/jquery/jquery.js"></script>
<script src="/static/js/layer/layer.js"></script>
<script type="text/javascript">
function btnEditMember(){
        var password = $("input[name=password]").val();
        var new_password = $("input[name=new_password]").val();
        var re_password = $("input[name=re_password]").val();

        if(!$.trim(password)) {
            layer.msg('请输入密码');
            return false;
        }
        if(!$.trim(new_password)) {
            layer.msg('请输入新密码');
            return false;
        }
        if($.trim(new_password)!=$.trim(re_password)) {
            layer.msg('新密码不一致');
            return false;
        }
        $.post('/index/user/password',{password:password,new_password:new_password},function(res){
            layer.msg(res.msg);
            if(res.code == 1){
                window.setTimeout(function(){
                    window.parent.location.reload();
                },1000);
            }
        });
    }
    </script>